package com.legolas.provider1.config.datasource;

/**
 * Created with IntelliJ IDEA.
 * User: Legolas
 * Date: 2017/7/17 0017
 */
public class DataSourceContextHolder {

    private static final ThreadLocal<DatasourceKey> datasourceKeys = new ThreadLocal<DatasourceKey>();


    public static DatasourceKey getDS(){
        return datasourceKeys.get();
    }

    public static void setDS(DatasourceKey dataSource){
        datasourceKeys.set(dataSource);
    }

    public static void clearDS(){
        datasourceKeys.remove();
    }
}